<template>
  <div>
    <button @click="login">登录</button>

    <p>
      {{ user }}
    </p>
  </div>
</template>
<script setup lang="ts">
import UserApi from "../src/api/user"
import { ref } from "vue";
const user = ref<{
  userAccount: string,
  userPassword: string
}>({
  userAccount: "yupi",
  userPassword: "12345678"
})

const login = async () => {
  const res: any = await UserApi.login(user.value)
  console.log(res.data);
  user.value = res.data
}
</script>

<style scoped></style>
